@extends('layout/layout')

@section('content')

	<div class="page-header">
        <h1>Todos os usuários</h1>
    </div>

    <div class="panel panel-default">
        <div class="panel-body">
            <a href="{{ action('UsersController@add') }}" class="btn btn-primary">Novo</a>
        </div>
    </div>
    
	<table class="table table-hover">
		
		<thead>
			<tr>
				<th>Nome</th>
				<th>Email</th>
				<th>Tipo</th>
				<th></th>
			</tr>
		</thead>
		
		<tbody>
		
			@foreach($users as $user)
				<tr>
					<td>{{ $user->name }}</td>
					<td>{{ $user->email }}</td>
					<td>{{ $user->type }}</td>
					<td align="right">
						<a href="{{ action('UsersController@edit', $user->id) }}" class="btn btn-default">Editar</a>
                        <a href="{{ action('UsersController@delete', $user->id) }}" class="btn btn-danger">Deletar</a>
					</td>
				</tr>
			@endforeach	
					
		</tbody>
		
	</table>
	
	{{ $users->links(); }}	
	
@stop